package com.example.demo.controller;

import com.example.demo.entity.Stu;
import com.example.demo.service.StuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class StuController {
    @Autowired
    private StuService stuService;
    @GetMapping(value = "/findStu/{id}")
    public Stu findStu(@PathVariable("id") Integer id){
        return stuService.findStuById(id);
    }
}
